package com.lzh.file.store;

import org.apache.commons.lang3.StringUtils;
import org.apache.tomcat.util.codec.binary.Base64;
import org.springframework.web.multipart.MultipartFile;

import java.io.File;
import java.io.InputStream;

public interface FileStoreApi {

    /**
     * excel,ppt,word,pdf,file 的文件图片预览 64位编码
     */
    String EXCEL_BASE64 = "iVBORw0KGgoAAAANSUhEUgAAAJYAAACWCAYAAAA8AXHiAAAKZElEQVR4Xu2da4wdZRnH/8/s2TNTL+wHDBpbw0VLabeGVW7aIJeglSiJBiKFxBsqXrCXPbPYoB9glUSs686stQ1QFTAQwKofFL9UkEDUWDDctKVpKxCTxUAMJiVEZs7unsfM2V2zLrt75jl73rdz5n3O132e/3ve//+35537UBAzQz/qQIcdIAWrw46qXNMBBUtBMOKAgmXEVhVVsJQBIw4sCFZSIzIymoqW0oGFttMVrFJGbXdSCpZdv50ZTcFyJmq7E1Ww7PrtzGgKljNR252ogmXXb2dGU7CcidruRBUsu347M5qC5UzUdieqYNn125nRFCxnorY7UQXLrt/OjKZgORO13YkqWHb9dmY0BcuZqO1OVMGy67czoylYzkRtd6IKll2/nRlNwXImarsTVbDs+u3MaAqWM1HbnaiCZddvZ0ZTsJyJ2u5EFSy7fjszmoLlTNR2J6pg2fXbmdEULGeitjtRBcuu386MpmA5E7XdiSpYdv12ZjQFy5mo7U5UwbLrtzOjKVjORG13ogqWXb+dGU3BciZquxNVsOz67cxoCpYzUdudqIJl129nRlOwnIna7kQVLLt+OzNaecG6nd8U/AfnSpNMenAQW+lf0r6W9cNcCfpwfsu6eQUJ468I6d/SvuNdX16wAAQx7wdwnsRkBvalNbpU0pOn1o/5egJG8tTO1jDjhbSCtdhKqaSvCLWlBsv/Ia/GFA4QoSoxu8HYVA9pr6Rnydrv8zv8Cp4nwgqRJuOiJKRHRT0FKS41WJnH1Zi/6QHfFfnNeCnxsRpfp9dEfYsU+xH/kghXSLSY8dM0pC9JeopUW3qwsJd7/HE8Q4R+ifEM7E5rtFnSs1BtMMoXw8PDQp2XkxRrcA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SqxHuRFJuNRbeYoKixHRZGBFWdHLKJU7O5xbVMATKEeBZwD7iOzQUMf0MsJCYDHw/o538JHJLZnualdD+zNWlFnT0yhPfju0u+qO3cxlePQLywmWzHb9PDtYkTujeiklHuuY9Fw6XahJRe+hXsaQRM97tj3igRVJNHQEmPEu62yD2N9z48AoFdkWZzbxwappiTKPAsviCFtM7hw4yDgrqMlEnJnFB2vqI3EBwh8R3hlH3GJy48Bz9PNBvi4vxp2RG1iR6oheTIk9CAviDmJxATug/IsJrmCb/NllFu5gTcF1NiV+irDcZTCLDc6Bg5S4Osm2S8nAivy5RQc4zj0InwnOLis4jgMPMs5nZ7ut0EooOVjTinX9EvAt+2iM06sAYqKPPthOVe7opNrOwYpG36FzaRJtSBvtHXpGJwVZbs8c+E90U4k+bmWLRD/FdXT4AWu6hGg/qwHWAesS/7jZ0XQs2dmBaLFAtKBznHupycvO+S0S/IL1xkGiPa2UlSgrUJYjXALM8VW46SRy4H/AIXTyfuRj9LOfLfJCIqVZkv4P5QGE8aDgniwAAAAASUVORK5CYII=";


    /**
     * 保存文件
     *
     * @param file 文件
     * @return filename 自动生成的UUID文件名
     */
    String save(File file);

    /**
     * 保存文件
     *
     * @param file 文件
     * @return filename 自动生成的UUID文件名
     */
    String save(MultipartFile file);

    /**
     * 保存文件
     *
     * @param stream    文件流
     * @param extension 文件扩展名
     * @see com.lzh.file.constant.FileConstant .FILE_EXTENSION_*
     */
    String save(InputStream stream, String extension);

    /**
     * @param filename 文件名
     */
    boolean deleteFile(String filename);

    /**
     * @param filename 文件名
     */
    boolean deleteFile(String[] filename);

    byte[] loadFileBytes(String filename);

    /**
     * 读取本地文件
     *
     * @param filename 文件名
     * @return
     */
    File loadFile(String filename);

    StringBuilder buildFullPath(String uuidName);

    /**
     * 文件预览
     *
     * @param filename
     * @return
     */
    default byte[] generatePreview(String filename) {
        if (StringUtils.endsWithAny(filename, ".png", ".jpg", ".jpeg")) {
            return loadFileBytes(filename);
        }

        String base64Str;

        if (StringUtils.endsWithAny(filename, ".doc", ".docx")) {
            base64Str = WORD_BASE64;
        } else if (StringUtils.endsWithAny(filename, ".xls", ".xlsx")) {
            base64Str = EXCEL_BASE64;
        } else if (StringUtils.endsWithAny(filename, ".ppt", ".pptx")) {
            base64Str = PPT_BASE64;
        } else if (StringUtils.endsWithAny(filename, ".pdf")) {
            base64Str = PDF_BASE64;
        } else {
            base64Str = FILE_BASE64;
        }

        return Base64.decodeBase64(base64Str);
    }
}
